package kr.saeildamil.androidstudty.ch13;

import kr.saeildamil.androidstudty.R;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ProgressBar;

public class ProgressBarTest extends Activity {
	ProgressBar mProgBar;
	ProgressBar mProgCircle;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
	
		super.onCreate(savedInstanceState);
		setContentView(R.layout.ch13_progressbar);
		mProgBar = (ProgressBar)findViewById(R.id.ch13_progressbar_progress);
		mProgCircle=(ProgressBar)findViewById(R.id.ch13_progressbar_progress_circle);
	}
	
	public void mOnClick(View v) {
		Intent intent=new Intent();
		switch(v.getId()){
		case R.id.ch13_progress_decfirst:
			mProgBar.incrementProgressBy(-2);			
			break;
		case R.id.ch13_progress_incfirst:
			mProgBar.incrementProgressBy(2);
			break;
		case R.id.ch13_progress_decsecond:
			mProgBar.incrementProgressBy(-2);
			break;
		case R.id.ch13_progress_incsecond:
			mProgBar.incrementProgressBy(2);
			break;
		case R.id.ch13_progress_start:
			mProgCircle.incrementProgressBy(View.VISIBLE);
			break;
		case R.id.ch13_progress_stop:
			mProgCircle.incrementProgressBy(View.INVISIBLE);
			break;
		
		}
		startActivity(intent);		
	}
		

	
}
